/*
 * @ DayOfTheWeek.java
 *
 */

import java.util.*;
import java.io.*;

/**
 * Displays the name of the day.
 * 
* @version 1.03
 * @date 28.01.2013
 * @author Yaroslav Tabachnyy
 * @mail Yaroslav.Tabachnyy@gmail.com
 * 
*/
public class DayOfTheWeek {

    public static int getWeekDayIndex(Date date) {
        return getWeekDayIndex(date.getYear(), date.getMonth(), date.getDate());
    }
   
    public static String getDayName(int dayIndex) {
        return WEEK_DAYS[dayIndex];
    }

     private static Date getInput(InputStream inputStream) {
        
        Scanner in = new Scanner(inputStream);
       
        System.out.println("Enter day: ");
        day = in.nextInt();
        System.out.println("Enter month: ");
        month = in.nextInt();
        System.out.println("Enter year: ");
        year = in.nextInt();
                        
        in.close();
        
        return Date (year,month,day);
    }


     public static void outputResult(String result) {
        System.out.println("Result: " + result);
    }
    
    public static void main(String[] args) {

        Date date = getInput(System.in);

       int dayIndex = getWeekDayIndex(date);
        String dayName = getWeekDayName(dayIndex);
       
        outputResult(dayName);

    }

    
  private static String getNumberDayWeek() {

 // Algotrithm from Wikipedia.
 // http://en.wikipedia.org/wiki/Calculating_the_day_of_the_week       
        
        int a = (14 - month) / 12;
        int y = (year - a);
        int m = month + 12 * a - 2;

        int result =
                (7000 + (day + y + y / 4 - y / 100 + y / 400 + (31 * m) / 12)) % 7;

        
    }
    
    public static String getNameDayWeek(int dayIndex) {
        return WEEK_DAYS[dayIndex];
    }

    private static void outputResult(String result) {

        System.out.println("Name day: " + result);

    }
}
